<template>
  <div class="container">
    <div class="container-header">
      <br>
      <strong>USER/CENTER</strong>
      <br>
      <strong>个人中心</strong>
    </div>
    <br>
    <div class="container-content">
      <div class="container-content-menu">
        <router-link to="/CenterView"><strong class="el-icon-s-custom">个人资料</strong></router-link>
        <br><br><br>
        <router-link to="/UpdatePassword"><strong class="el-icon-key">修改密码</strong></router-link>
        <br><br><br>
        <router-link to="/PayView"><strong class="el-icon-medal">充值积分</strong></router-link>
      </div>
      <div class="container-content-body">
        <router-view/>
      </div>
    </div>

  </div>
</template>

<script>

export default {
  name: "PersonCenterView",
  mounted() {
    const user = JSON.parse(localStorage.getItem('xm-user'))
    if (!user) {
      this.$message.error('请先登录')
      setTimeout(() => {
        this.$router.push('/Login')
      }, 500)
    }
  }
}
</script>

<style scoped lang="scss">
.container {
  padding-top: 93px;
  width: 800px;
  margin: 0 auto;

  .container-header {
    height: 200px;
    background: url("@/assets/image/person-bgimg.jpg") no-repeat center;
    background-size: cover;
    color: white;
    text-align: center;
    font-size: 25px;
  }

  .container-content {
    padding: 10px;
    border-radius: 10px;
    display: flex;

    a {
      text-decoration: none;
      color: white;
      transition: color .5s;
      background-color: #af6363;
      padding: 10px;
      border-radius: 10px;
    }

    a:hover {
      color: black;
    }

    .container-content-menu {
      padding: 10px;
      border-radius: 10px;
    }

    .container-content-body {
      width: 80%;
      height: 750px;
      padding: 10px;
      border-radius: 10px;
      box-shadow: 1px 1px 10px 0 #af6363;
      margin-left: 10px;
    }
  }
}
</style>
